package com.example.sunlight.wzoneunicom;

import android.app.Activity;
import android.view.Display;
import android.view.WindowManager;

import java.util.Random;

/**
 * Created by SunLight on 2017/7/19.
 */

public class Randoms {
    WindowManager windowManager;
    Display display;
    int screenWidth;
    int screenHeight;

    public Randoms(Activity activity) {
        windowManager = activity.getWindowManager();
        display = windowManager.getDefaultDisplay();
        screenWidth = display.getWidth();
        screenHeight = display.getHeight();
    }

    public int screenWidth() {
        return screenWidth;
    }

    public int screenHeight() {
        return screenHeight;
    }

    public int HRandom() {
        int maxH = 250;
        int minH = 100;
        Random random = new Random();
        int s = getRandomNum(minH, maxH);
        return -s;
    }

    public int getRandomNum(int smallistNum, int BiggestNum) {
        Random random = new Random();
        return (Math.abs(random.nextInt()) % (BiggestNum - smallistNum + 1)) + smallistNum;
    }

    public int WRandom() {
        int maxW = 300;
        int minW = -300;
        Random random = new Random();
        int s = getRandomNum(minW, maxW);
        return s;
    }
}
